package com.springboot.chapter4.aspect.service.impl;

import com.springboot.chapter4.aspect.pojo.User;
import com.springboot.chapter4.aspect.service.UserService;
import org.springframework.stereotype.Service;

/**
 * 作者：paopao
 * 版本：1.0
 */
@Service
public class UserServiceImpl implements UserService {
    @Override
    public void printUser(User user) {
        if (user == null) {
            throw new IllegalArgumentException("user 不能为空");
        }
        System.out.print("id =" + user.getId());
        System.out.print("\tname =" + user.getName());
        System.out.println("\tnote =" + user.getNote());
    }

    @Override
    public void manyAspects() {
        System.out.println("测试多个切面顺序");
    }
}

//@Service
//public class UserServiceImpl {
//    public void printUser(User user) {
//        if (user == null) {
//            throw new IllegalArgumentException("user 不能为空");
//        }
//        System.out.print("id =" + user.getId());
//        System.out.print("\tname =" + user.getName());
//        System.out.println("\tnote =" + user.getNote());
//    }
//
//}
